package exception;

public class TryCatchDemo {
    public static void main(String[] args) {
        System.out.println("start");
        try {
            String s = null;
            System.out.println(s.length());
            String s1="hhh111";
            System.out.println(s1.charAt(4));
            System.out.println(Integer.parseInt(s1));
        }
        catch (StringIndexOutOfBoundsException|NullPointerException e)
        {
            System.out.println("Ok");
        }
        catch (Exception e)
        {
            System.out.println("出现未知错误");
        }
        System.out.println("finish");
    }
}
